var e = getApp();

Page({
    data: {
        ruleContent: "",
        share_title: "",
        share_icon: ""
    },
    onLoad: function(e) {
        this._getRule(), this._getShareData();
    },
    onReady: function() {},
    onShow: function() {
        wx.showShareMenu({
            withShareTicket: !1,
            menus: [ "shareAppMessage", "shareTimeline" ]
        });
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareTimeline: function() {
        return {
            title: this.data.share_title,
            imageUrl: this.data.share_icon
        };
    },
    onShareAppMessage: function() {
        return {
            title: this.data.share_title,
            imageUrl: this.data.share_icon
        };
    },
    _getRule: function() {
        var t = this, a = e.getNetAddresss("plugin.clock-in.api.clock-in.get-rule");
        e._getNetWork({
            url: a,
            success: function(e) {
                var a = e.data;
                1 == a.result && t.setData({
                    ruleContent: a.data.rule
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    },
    _getShareData: function() {
        var t = this, a = e.getNetAddresss("plugin.clock-in.api.clock-in.get-set");
        e._getNetWork({
            url: a,
            success: function(e) {
                var a = e.data;
                1 == a.result && t.setData({
                    share_title: a.data.share.share_title,
                    share_icon: a.data.share.share_icon
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    }
});